import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';

/// * 作者: Tao
/// * 日期: 2024/3/20
/// * 时间: 13:56
/// * 描述: 基类，无状态View
abstract class GetNoBindingView<T extends GetxController> extends StatelessWidget {
  const GetNoBindingView({super.key});

  final String? tag = null;

  T get controller => GetInstance().find<T>(tag: tag);

  @protected
  Widget buildWidget(BuildContext context);

  @override
  Widget build(BuildContext context){
    return GetBuilder<T>(
        builder: (controller) {
          return buildWidget(context);
        }
    );
  }
}